<template>
  <div class="page-style">
    <level-btn @reloadFun="reloadFun" />
    <level-tab :table-data="levelList" @reloadFun="reloadFun" />
  </div>
</template>

<script>
import levelBtn from './components/brand_level/level_btn'
import levelTab from './components/brand_level/level_tab'
import { getBrandsLevels } from '@/api/brand'
export default {
  components: {
    levelBtn,
    levelTab
  },
  data() {
    return {
      levelList: []
    }
  },
  created() {
    this.getBrandLevelFun()
  },
  methods: {
    getBrandLevelFun() {
      console.log('获取')
      const data = {
        brand_id: this.$store.state.user.brand_id
      }
      getBrandsLevels(data).then(res => {
        console.log(res)
        if (res.list.length !== 0) {
          this.levelList = res.list
        }
      })
    },
    reloadFun() {
      this.getBrandLevelFun()
    }
  }
}
</script>

<style scoped>

</style>
